package main

import (
	"github.com/gookit/color"
	"golang.org/x/oauth2"
	"lover/utilx/auth2x"
)

func login() {
	url := auth2x.GiteeAuthUrl(oauth2.Config{
		ClientID:     auth2x.ClientID,
		ClientSecret: auth2x.ClientSecret,
		Endpoint: oauth2.Endpoint{
			AuthURL:       auth2x.GiteeOauth.String(),
			DeviceAuthURL: "",
			TokenURL:      auth2x.GiteeToken.String(),
			AuthStyle:     0,
		},
		Scopes:      auth2x.GiteeScope,
		RedirectURL: "http://admin.ktv2t7iv2gxichec.com:8080/",
	})
	color.Redln(url)
}

func main() {
	//code := "c54ac0d2ac5526ee3c70f106ea66f6f228b1493adfc02c434e1414765ab849d5"
	login()
	//https://gitee.com/oauth/authorize?client_id=8990ca6b3fdadb6463fbf9ec80f6302e782d60d66e6552eb7a99824c3d0e76f3&redirect_uri=http%3A%2F%2Fadmin.ktv2t7iv2gxichec.com%3A8080%2F&response_type=code

}
